import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        screenWidth:0,
        weatherData:'',
        cnode:'<p>您访问的链接即将离开</p><p><strong>“西安旅游网”</strong>网站</p><p style="color: #d20000; font-weight: 900;">是否继续？</p>'
    },
    mutations: {
        setScreenWidth(state) {
            state.screenWidth = window.innerWidth;
        },
        setWeatherData(state,data) {
            state.weatherData = data;
        }
    },
    actions: {
        setScreenWidth({ commit }, data) {
            commit('setScreenWidth', data);
        }
    },
    getters: {
        screenWidth(state) {
            return  state.screenWidth;
        }
    }
  
})